import { changeCountTypes } from "./types";


export const count =(state=2114,action)=>{
  const{type,payload}=action;
  switch(type){
    case "countAdd":
                
              return ++state;    //一直是旧的state
              break
            
      
               case "countDesc":
                 
               return --state;  //解构 返回新的state
               break;
      
                case changeCountTypes:
                return state+payload;  //解构 返回新的state
                break;


 
          default:
          return state
          break;
  }
}